<template>
    <div class="header">
    

    </div>
</template>
<script>


import bus from './bus';

export default {
    data() {
        return {
			pwdlog:false,
            systype:'1',
			stcd:'',
			newyear:'',
			pwdform:{
				userNo:localStorage.getItem('nowuserno')
			},
			form:{
				year:''
			},
			dialogVisible:false,
            collapse: true,
            fullscreen: false,
            name: '',
            message: 2,
			stationData:[],
			globalyear:'',
			stationInfo:{
				
			},
            AllstationData:[]
        };
    },
    computed: {
       
    },
    methods: {
		qiehuan(){
			this.$router.push('/pageselect');
		},
		chpwd(){
			let that=this
			
			soilwatersysusereditmodifyPassword({
				oldPassword:md5(that.pwdform.oldPassword),
				newPassword:md5(that.pwdform.newPassword),
				userNo:that.pwdform.userNo
			}).then(e=>{
				that.pwdlog=false
				that.$message.success('操作成功');
			}).catch(err=>{
				console.log(err)
			})
		},
        qiehuanbtn(){
			
			
			this.systype =systype
			
			this.stationInfo=stationInfo
			
			       
			this.form.year=globalyear
			this.stcd=stationInfo.stcd
			this.newyear=globalyear
		
			
			
			
			
			this.dialogVisible=true;
			this.newyear=this.form.year
		},
		suresel(){
           
            
            systype=this.systype
            localStorage.setItem("systype",systype)
			this.form.year=this.newyear
			let data=this.stationData.filter(item=>{
				return item.stcd===this.stcd
			})[0]
			
			
			stationInfo={
                calculator:this.stationData.filter(item=>{
					return item.stcd===this.stcd
				})[0].calculator,
                reviewer:this.stationData.filter(item=>{
					return item.stcd===this.stcd
				})[0].reviewer,
                observer:this.stationData.filter(item=>{
					return item.stcd===this.stcd
				})[0].observer,
				stcd:this.stcd,
				stnm:this.stationData.filter(item=>{
					return item.stcd===this.stcd
				})[0].stnm,
                observerName:this.stationData.filter(item=>{
					return item.stcd===this.stcd
				})[0].observerName,
                reviewerName:this.stationData.filter(item=>{
					return item.stcd===this.stcd
				})[0].reviewerName,
                calculatorName:this.stationData.filter(item=>{
					return item.stcd===this.stcd
				})[0].calculatorName
			}
			this.stationInfo.stnm=stationInfo.stnm
			globalyear=this.form.year
			 
			localStorage.setItem("globalyear",globalyear)
			localStorage.setItem("stationInfo",JSON.stringify(stationInfo))
			this.dialogVisible=false
           
            location.href=location.origin+location.pathname+'#/mapindex'
			location.reload();
		},
		getxiaoqu(){
			
			reportareaInfoviewlistStationArea({
				pageSize:100,
				currentPage:1,
				stcd:stationInfo.stcd
			}).then(e=>{
				sessionStorage.setItem('xiaoquxinxi',JSON.stringify(e.object))
			}).catch(err=>{
				console.log(err)
			})
		},
        comStation(on){
			
			if(this.systype==3){
				this.$router.push('/pageselect');
			    // let url=location.origin+location.pathname
			        
			    // window.location.href="http://10.36.15.23:8888/sbsj/web/#/home?token="+sessionStorage['token']+'&urlpath='+encodeURIComponent(url)
			    return
			}
            this.stationData = this.AllstationData.filter(item=>{
                return item.stType==this.systype
            });
            
            if(on){
                this.stcd=''
            }
        },
		getstationData() {
			let data={
				currentPage:1,
				pageSize:1000
			}
            let that=this
		    viewPageStationInfo(data).then((res) => {
		        that.AllstationData=res.object.dataList
		        
		        that.comStation()
		       
		    });
		},
        // 用户名下拉菜单选择事件
        handleCommand(command) {
            if (command == 'loginout') {
                localStorage.removeItem('ms_username');
                sessionStorage.removeItem('token');
                sessionStorage.removeItem('menuList');
                this.$router.push('/login');
            }else{
				this.pwdlog=true
			}
        },
        // 侧边栏折叠
        collapseChage() {
            
            this.collapse = !this.collapse;
            bus.emit('collapse', this.collapse);
        },
        // 全屏事件
        handleFullScreen() {
            let element = document.documentElement;
            if (this.fullscreen) {
                if (document.exitFullscreen) {
                    document.exitFullscreen();
                } else if (document.webkitCancelFullScreen) {
                    document.webkitCancelFullScreen();
                } else if (document.mozCancelFullScreen) {
                    document.mozCancelFullScreen();
                } else if (document.msExitFullscreen) {
                    document.msExitFullscreen();
                }
            } else {
                if (element.requestFullscreen) {
                    element.requestFullscreen();
                } else if (element.webkitRequestFullScreen) {
                    element.webkitRequestFullScreen();
                } else if (element.mozRequestFullScreen) {
                    element.mozRequestFullScreen();
                } else if (element.msRequestFullscreen) {
                    // IE11
                    element.msRequestFullscreen();
                }
            }
            this.fullscreen = !this.fullscreen;
        }
    },
    mounted() {
        
    }
};
</script>
<style scoped>
.header {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 70px;
    font-size: 16px;
    color: #fff;
}
.collapse-btn {
    float: left;
    width:60px;
    cursor: pointer;
    height: 70px;
	background:url(./wasicon.png) no-repeat center;
	background-size:34px auto;
	
}
.header .logo {
	font-size:34px;
    float: left;
    width: 532px;
    line-height: 70px;
	color:#fff;
	font-family:dabiaoti;
}
.header-right {
    float: right;
    padding-right: 50px;
}
.header-user-con {
    display: flex;
    height: 70px;
    align-items: center;
}
.btn-fullscreen {
    transform: rotate(45deg);
    margin-right: 5px;
    font-size: 24px;
}
.btn-bell,
.btn-fullscreen {
    position: relative;
    width: 30px;
    height: 30px;
    text-align: center;
    border-radius: 15px;
    cursor: pointer;
}
.btn-bell-badge {
    position: absolute;
    right: 0;
    top: -2px;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: #f56c6c;
    color: #fff;
}
.btn-bell .el-icon-bell {
    color: #fff;
}
.user-name {
    margin-left: 10px;
}
.user-avator {
    margin-left: 20px;
}
.user-avator img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.el-dropdown-link {
    color: #fff;
    cursor: pointer;
}
.el-dropdown-menu__item {
    text-align: center;
}
</style>
